import asyncio
import backoff

from retrying import retry


@retry(stop_max_attempt_number=3, wait_random_min=500, wait_random_max=1000)
async def async_task():
    # Your asynchronous task here
    print(123)
    return 1/0


@retry(stop_max_attempt_number=3, wait_random_min=500, wait_random_max=1000)
def sync_task():
    # Your asynchronous task here
    print(456)
    return 1/0


@backoff.on_exception(backoff.expo,
                      Exception,
                      max_tries=8)
async def async_function_that_might_fail():
    pass


if __name__ == '__main__':
    asyncio.run(async_task())
    # sync_task()
